package com.yq.ylmall.model.product;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yq.ylmall.model.base.BaseEntity;
import com.yq.ylmall.vo.product.CategoryVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

/**
 * <p>
 * 商品分类
 * </p>
 *
 * @author yzk789
 * @since 2024-05-30
 */
@Data
@TableName("category")
@ApiModel(value = "Category对象", description = "商品分类")
public class Category extends BaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "分类名称")
    private String name;

    @ApiModelProperty(value = "图片地址")
    private String imageUrl;

    @ApiModelProperty(value = "父分类id")
    private Long parentId;

    @ApiModelProperty(value = "是否显示[0：不显示，1：显示]")
    private Integer status;

    @ApiModelProperty(value = "排序")
    private Integer orderNum;

    @ApiModelProperty(value = "是否存在子节点")
    @TableField(exist = false)
    private Boolean hasChildren;

    // 下级列表
    @TableField(exist = false)
    private List<CategoryVo> children;

}
